package com.wufun.overseas.models.bean;






import com.wufun.overseas.utils.StringUtils;

import java.io.Serializable;

/**
 * banner 和table的实体是一样的、
 * Created by pengsk on 2014/12/26.
 */
public class BannerBean implements Serializable {
    private String title;
    private String sub_title;
    private String pic_remote;
    private int link_type;
    private int jump_type;
    private String link_type_val;
    private String tpl_type;
    private String crc_link_type_val;
    private String game_info_tpl_type;
    private int ad_switch;
    private String label;

    public BannerBean() {
    }

    public BannerBean(String title, String pic_remote, int link_type, int jump_type, String link_type_val, String tpl_type, String crc_link_type_val, String game_info_tpl_type) {
        this.title = title;
        this.pic_remote = pic_remote;
        this.link_type = link_type;
        this.jump_type = jump_type;
        this.link_type_val = link_type_val;
        this.tpl_type = tpl_type;
        this.crc_link_type_val = crc_link_type_val;
        this.game_info_tpl_type = game_info_tpl_type;
    }

    public String getSub_title() {
        return sub_title;
    }

    public void setSub_title(String sub_title) {
        this.sub_title = sub_title;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public int getAd_switch() {
        return ad_switch;
    }

    public void setAd_switch(int ad_switch) {
        this.ad_switch = ad_switch;
    }

    public String getGame_info_tpl_type() {
        return game_info_tpl_type;
    }

    public void setGame_info_tpl_type(String game_info_tpl_type) {
        this.game_info_tpl_type = game_info_tpl_type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPic_remote() {
        return pic_remote;
    }

    public void setPic_remote(String pic_remote) {
        this.pic_remote = pic_remote;
    }

    public int getLink_type() {
        return link_type;
    }

    public void setLink_type(int link_type) {
        this.link_type = link_type;
    }

    public int getJump_type() {
        return jump_type;
    }

    public void setJump_type(int jump_type) {
        this.jump_type = jump_type;
    }

    public String getLink_type_val() {
        return link_type_val;
    }

    public void setLink_type_val(String link_type_val) {
        this.link_type_val = link_type_val;
    }

    public String getTpl_type() {
        return tpl_type;
    }

    public void setTpl_type(String tpl_type) {
        this.tpl_type = tpl_type;
    }

    public String getCrc_link_type_val() {
        return crc_link_type_val;
    }

    public void setCrc_link_type_val(String crc_link_type_val) {
        this.crc_link_type_val = crc_link_type_val;
    }


    public IntentDateBean getIntentDataBean() {
        IntentDateBean intentDateBean = new IntentDateBean();
        intentDateBean.setJump_type(jump_type);
        intentDateBean.setLink_type(link_type);
        intentDateBean.setLink_type_val(link_type_val);
//        if(link_type== StaticFinalNumberUtil.LINK_TYPE_APP_DETIAL){
//            intentDateBean.setTpl_type(game_info_tpl_type);
//        }else {
//            intentDateBean.setTpl_type(tpl_type);
//        }
        intentDateBean.setCrc_link_type_val(crc_link_type_val);
        if (StringUtils.isNotEmpty(title)){
            intentDateBean.setObject(title);
        }
        return intentDateBean;

    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BannerBean that = (BannerBean) o;

        if (link_type != that.link_type) return false;
        if (jump_type != that.jump_type) return false;
        if (!StringUtils.getSafeString(title).equals(StringUtils.getSafeString(that.title))) return false;
        if (!StringUtils.getSafeString(pic_remote).equals(StringUtils.getSafeString(that.pic_remote))) return false;
        if (!StringUtils.getSafeString(link_type_val).equals(StringUtils.getSafeString(that.link_type_val)))
            return false;
        if (!StringUtils.getSafeString(tpl_type).equals(StringUtils.getSafeString(that.tpl_type))) return false;
        if (!StringUtils.getSafeString(crc_link_type_val).equals(StringUtils.getSafeString(that.crc_link_type_val)))
            return false;
        return StringUtils.getSafeString(game_info_tpl_type).equals(StringUtils.getSafeString(that.game_info_tpl_type));

    }

    @Override
    public int hashCode() {
        int result = title.hashCode();
        result = 31 * result + pic_remote.hashCode();
        result = 31 * result + link_type;
        result = 31 * result + jump_type;
        result = 31 * result + link_type_val.hashCode();
        result = 31 * result + tpl_type.hashCode();
        result = 31 * result + crc_link_type_val.hashCode();
        result = 31 * result + game_info_tpl_type.hashCode();
        return result;
    }
}
